﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;
namespace GUI
{
    public partial class frmDangNhap : Form
    {
        public String MaNV;
        public frmDangNhap()
        {
            InitializeComponent();
        }

        private void btDangNhap_Click(object sender, EventArgs e)
        {
            NhanVienDTO nvDTO = new NhanVienDTO();
            nvDTO.MaNV = txtUser.Text.Trim();
            nvDTO.Pass = txtPass.Text.Trim();
            NhanVienBUS bus = new NhanVienBUS();
            int res = bus.DangNhap(txtUser.Text.Trim(), txtPass.Text.Trim());
            if (res == 1)
            {
                Secssion.Sec.Add(txtUser.Text.Trim());
                this.Close();
            }
            else
                MessageBox.Show("Lỗi Đăng Nhập");
        }
    }
}
